package cn.lixin.user.controller;

import cn.lixin.basic.utils.AjaxResult;
import cn.lixin.user.service.IVerifyCodeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {

    @Autowired
    private IVerifyCodeService verifyCodeService;

    @PostMapping("/smsCode")
    @ApiOperation(value = "发送验证码",notes = "发送验证码")
    public AjaxResult send(@RequestBody Map<String,String> param){
        try {

            verifyCodeService.send(param);
            return AjaxResult.me();
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.me().setSuccess(false).setMessage("操作失败");
        }
    }
}
